import javax.annotation.Resource;
import javax.jws.WebService;
import javax.xml.ws.Endpoint;
import javax.xml.ws.WebServiceContext;

/*
 * 1. cd /home/arthur/Study/Java6Study/Sample/bin
 * 2. wsgen -cp . WSTester
 * 3. run WSTester
 * 4. visit http://localhost:7070/ws?wsdl in browser
 */
@WebService(targetNamespace="http://mywstest/wstester",serviceName="AddService")
public class WSTester {

	@Resource
	WebServiceContext context;

	public int add(int a, int b) {
		return a + b;
	}

	public static void main(String[] args) {
		System.out.println("Starting endpoint with address http://localhost:7070/ws");
		Endpoint.publish("http://localhost:7070/ws", new WSTester());

	}

}
